package com.zzl.bonds.ticket.dto.credit;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zzl.apidoc.annotation.ApidocModel;
import com.zzl.apidoc.annotation.ApidocModelProperty;
import com.zzl.bonds.ticket.entity.EnterpriseCreditDataEntity;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * @author : spp
 * @date : 2022/3/11 11:02
 */
@Data
@ApidocModel
public class AddOrUpdateCreditDto {

    @ApidocModelProperty(description = "update 时传入，add 无需传入 ")
    private String id;

    @ApidocModelProperty(description = "额度编号")
    private String creditNo;

    @ApidocModelProperty(description = "企业id，即集团的企业id")
    private String enterpriseId;
    @ApidocModelProperty(description = "授信主体")
    private String enterpriseName;

    @ApidocModelProperty(description = "金融机构id")
    private String financeInstitutyId;

    @ApidocModelProperty(description = "金融机构名称")
    private String financeInstitutyName;

    @ApidocModelProperty(description = "额度类型，1 集团授信 2 独立授信")
    private Integer creditType;

    @ApidocModelProperty(description = "总金额")
    private Double creditAllAmount;

    @ApidocModelProperty(description = "生效日期", validate = "yyyy-MM-dd")
    private Date effectiveDate;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApidocModelProperty(description = "失效日期", validate = "yyyy-MM-dd")
    private Date expiryDate;

    @ApidocModelProperty(description = "冻结额度/平台操作的锁定额度 ")
    private Double creditLockAmount;

    @NotNull(message = "是否冻结 状态不能为空 ")
    @ApidocModelProperty(description = "是否冻结 0 未冻结 1 已冻结 ")
    private Integer lockStatus;

    @ApidocModelProperty(description = "备注")
    private String remark;

    @ApidocModelProperty(description = "附件资料")
    List<EnterpriseCreditDataEntity> datas;
}
